Image Reader, and Method and Computer-Readable Medium for the Same

ABSTRACT

An image reader including a document table having a reference point, a first region of a sheet having a predetermined size when a vertex of the sheet is positioned on the reference point, and a second region, a changing mechanism changing a reading position in a sub scanning direction, and a controller configured to control the changing mechanism to change the reading position to a first position such that a distance in the sub scanning direction between the reference point and the first position corresponds to a length of the predetermined sheet size in the sub scanning direction, acquire specific digital data of the second region through image reading in the first position with a light source turned off, compare a particular value of the specific digital data with a criterion value within the second region, and determine a state of a document cover based on the comparison.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No.15/395,148, filed Dec. 30, 2016, which is a continuation of U.S. patentapplication Ser. No. 14/837,098 filed on Aug. 27, 2015, which claimspriority under 35 U.S.C. § 119 from Japanese Patent Application No.2014-175069 filed on Aug. 29, 2014. The entire content of all of theseapplications are incorporated herein by reference.

BACKGROUND Technical Field

The following description relates to one or more aspects of an imagereader.

Related Art

In reading a document placed on a document table of an image reader, itis required to determine whether a document cover is in a fully-closedstate. An image reader has been known that is configured to detect anopen/closed state of a document cover using a cover state sensor, andperform document reading with a light source turned on.

SUMMARY

However, as the known image reader detects the open/closed state of thedocument cover using the cover state sensor, the image reader needs alarge apparatus body. Further, the image reader needs a complicatedconfiguration for detecting an output signal from the cover statesensor.

Aspects of the present disclosure are advantageous to provide one ormore improved techniques, for an image reader, which make it possible todetect an open/closed state of a document cover even without a coverstate sensor.

According to aspects of the present disclosure, an image reader isprovided, which includes a document table configured to support adocument placed thereon, the document table having a reference point onwhich a vertex of the document is positioned, a first region defining anarea of a predetermined sheet size with respect to the reference point,and a second region different from the first region, a document covermovable between an open state and a closed state, the document coverbeing configured to cover an upper surface of the document table whenthe document cover is in the closed state, a reading unit including alight source configured to emit light toward the document placed on thedocument table, the reading unit being configured to perform imagereading on a line-by-line basis along a main scanning direction, andoutput analog data as read data, a converter configured to convert theanalog data output from the reading unit into digital data, a changingmechanism configured to change a reading position where image reading isperformed, in a sub scanning direction perpendicular to the mainscanning direction, and a controller configured to control the changingmechanism to change the reading position to a first position, the firstposition being such a position that a distance in the sub scanningdirection between the reference point and the first position correspondsto a length of the predetermined sheet size in the sub scanningdirection, acquire specific digital data of the second region throughimage reading in the first position with the light source turned off,compare a particular value of the specific digital data with apredetermined criterion value within the second region, and determine anopen/closed state of the document cover, based on the comparison of theparticular value of the specific digital data with the predeterminedcriterion value within the second region.

According to aspects of the present disclosure, further provided is amethod adapted to be implemented on a processor coupled with an imagereader including a document table configured to support a documentplaced thereon, the document table having a reference point on which avertex of the document is positioned, a first region defining an area ofa predetermined sheet size with respect to the reference point, and asecond region different from the first region, a document cover movablebetween an open state and a closed state, the document cover beingconfigured to cover an upper surface of the document table when thedocument cover is in the closed state, a reading unit including a lightsource configured to emit light toward the document placed on thedocument table, the reading unit being configured to perform imagereading on a line-by-line basis along a main scanning direction, andoutput analog data as read data, a converter configured to convert theanalog data output from the reading unit into digital data, and achanging mechanism configured to change a reading position where imagereading is performed, in a sub scanning direction perpendicular to themain scanning direction, the method including causing the changingmechanism to change the reading position to a first position, the firstposition being such a position that a distance in the sub scanningdirection between the reference point and the first position correspondsto a length of the predetermined sheet size in the sub scanningdirection, acquiring specific digital data of the second region throughimage reading in the first position with the light source turned off,comparing a particular value of the specific digital data with apredetermined criterion value within the second region, and determiningan open/closed state of the document cover, based on the comparison ofthe particular value of the specific digital data with the predeterminedcriterion value within the second region.

According to aspects of the present disclosure, further provided is anon-transitory computer-readable medium storing computer-readableinstructions that are executable by a processor coupled with an imagereader including a document table configured to support a documentplaced thereon, the document table having a reference point on which avertex of the document is positioned, a first region defining an area ofa predetermined sheet size with respect to the reference point, and asecond region different from the first region, a document cover movablebetween an open state and a closed state, the document cover beingconfigured to cover an upper surface of the document table when thedocument cover is in the closed state, a reading unit including a lightsource configured to emit light toward the document placed on thedocument table, the reading unit being configured to perform imagereading on a line-by-line basis along a main scanning direction, andoutput analog data as read data, a converter configured to convert theanalog data output from the reading unit into digital data, and achanging mechanism configured to change a reading position where imagereading is performed, in a sub scanning direction perpendicular to themain scanning direction, the instructions being configured to, whenexecuted by the processor, cause the processor to control the changingmechanism to change the reading position to a first position, the firstposition being such a position that a distance in the sub scanningdirection between the reference point and the first position correspondsto a length of the predetermined sheet size in the sub scanningdirection, acquire specific digital data of the second region throughimage reading in the first position with the light source turned off,compare a particular value of the specific digital data with apredetermined criterion value within the second region, and determine anopen/closed state of the document cover, based on the comparison of theparticular value of the specific digital data with the predeterminedcriterion value within the second region.

BRIEF DESCRIPTION OF THE ACCOMPANYING DRAWINGS

FIG. 1A is a front view schematically showing an internal configurationof an image reader in an illustrative embodiment according to one ormore aspects of the present disclosure.

FIG. 1B is a plane view of a transparent plate of the image reader inthe illustrative embodiment according to one or more aspects of thepresent disclosure.

FIG. 2 is a block diagram schematically showing a configuration of acontrol system of the image reader in the illustrative embodimentaccording to one or more aspects of the present disclosure.

FIG. 3 is a flowchart showing a procedure of a power-on process to beexecuted when the image reader is powered on, in the illustrativeembodiment according to one or more aspects of the present disclosure.

FIGS. 4A and 4B are flowcharts showing a procedure of a document sizedetermining process in the illustrative embodiment according to one ormore aspects of the present disclosure.

FIGS. 5A and 5B are flowcharts showing a procedure of a document sizeredetermining process in the illustrative embodiment according to one ormore aspects of the present disclosure.

FIGS. 6A and 6B are flowcharts showing a procedure of a reading processin the illustrative embodiment according to one or more aspects of thepresent disclosure.

FIGS. 7A to 7E show relationships between a position in a main scanningdirection and digital data in respective states of a document cover, inthe illustrative embodiment according to one or more aspects of thepresent disclosure.

FIGS. 8A to 8E show relationships between the position in the mainscanning direction and a gradation value in respective states of thedocument cover, in the illustrative embodiment according to one or moreaspects of the present disclosure.

DETAILED DESCRIPTION

It is noted that various connections are set forth between elements inthe following description. It is noted that these connections in generaland, unless specified otherwise, may be direct or indirect and that thisspecification is not intended to be limiting in this respect. Aspects ofthe present disclosure may be implemented on circuits (such asapplication specific integrated circuits) or in computer software asprograms storable on computer-readable media including but not limitedto RAMs, ROMs, flash memories, EEPROMs, CD-media, DVD-media, temporarystorage, hard disk drives, floppy drives, permanent storage, and thelike.

Hereinafter, an illustrative embodiment according to aspects of thepresent disclosure will be described with reference to the accompanyingdrawings.

[Configuration of Image Reader]

FIG. 1A is a front view of an image reader SM in an illustrativeembodiment according to aspects of the present disclosure. The imagereader SM includes a document table DT and a document cover CV. Thedocument table DT includes a main body MD and a transparent plate TP.The main body MB is a housing configured to accommodate various members(such as the transparent plate TP and a reading unit RU). Thetransparent plate TP is disposed in and fixedly attached to the mainbody MB. The transparent plate TP is configured to support a documentplaced thereon. The document cover CV is disposed above the main bodyMB. The document cover CV is configured to be open and closed relativeto the main body MB. Specifically, the document cover CV is openablefrom a front side of the main body MD by rotating around a rotationalaxis disposed at a rear side of the main body MB (i.e., at a far side ina direction perpendicular to a flat surface on which FIG. 1A is drawn).Namely, the document cover CV has the rotational axis thereof disposedat a side of a below-mentioned margin region MR, and is openable from aside of a below-mentioned non-document-placed region NDR. Adownward-facing surface (i.e., a surface facing towards the transparentplate TP) of the document cover CV is colored white.

The image reader SM further includes the reading unit RU. The readingunit RU is disposed below the transparent plate TP, inside the main bodyMB. The reading unit RU is movable along a sub scanning direction (i.e.,a left-to-right direction in FIG. 1A) relative to the main body MB. Thereading unit RU is configured to read an image of the document placed onthe transparent plate TP. The reading unit RU includes a contact imagesensor (hereinafter referred to as a “CIS”). More specifically, thereading unit RU includes a light source LS, a rod lens RL, and an imagesensor IS. The light source LS is configured to emit light towards thetransparent plate TP. The rod lens RL is configured to receive reflectedlight of the light emitted by the light source LS. The image sensor ISis configured to receive the light transmitted through the rod lens RL.More specifically, the image sensor IS includes a plurality of opticalelements arranged along a main scanning direction (i.e., a directionperpendicular to the flat surface on which FIG. 1A is drawn). Namely,the image sensor IS is a line sensor configured to perform image readingon a line-by-line basis along the main scanning direction in which theplurality of optical elements are arranged. Hereinafter, in the subscanning direction, a position where the image sensor IS exists may bereferred to as a “reading position.”

FIG. 1B is a plane view of the transparent plate TP. The transparentplate TP is formed in a rectangular shape having a long side extendingalong the sub scanning direction and a short side extending along themain scanning direction. At an end portion (i.e., a left end portion inFIG. 1B) of an exposed surface of the transparent plate TP that isexposed towards the document cover CV, a reference point OP is defined.The reference point OP is a point on which a vertex of a document DC isto be positioned. On the transparent plate TP, the document DC isplaced. An A4-size document DC placed landscape (with a longitudinaldirection thereof along the sub scanning direction) is indicated by adashed line in FIG. 1B, and may be referred to as an “A4-landscapedocument DC.” The “landscape-placed state” is a state where the documentDC is placed on the transparent plate TP in such a manner that longsides of the document DC are along long sides of the exposed surface ofthe transparent plate TP and that short sides of the document DC arealong short sides of the exposed surface of the transparent plate TP. Ashort side of the document DC that includes the reference point OP isdefined as a reference side. A short side of the document DC that isopposed to the reference side is defined as an opposed side. In thefollowing description, a position of the reference side in the subscanning direction may be referred to as a “reference position BP.” Aposition of the opposed side of the A4-landscape document DC in the subdirection may be referred to as an “A4-landscape position LP.” In thesub scanning direction, a long side, including the reference point OP,of the exposed surface of the transparent plate TP may be referred to asa “reference line.” It is noted that the transparent plate TP has such asize that an A3-size document DC is allowed to be placed landscape as amaximum-size document. The A3-size document DC placed landscape (with alongitudinal direction thereof along the sub scanning direction) isindicated by an alternate long and short dash line in FIG. 1B, and maybe referred to as an “A3-landscape document DC.”

In the main scanning direction, a margin region MR (hatched with apattern of lines inclined upward to the right in FIG. 1B) is defined asa part of a document-placed region (where a document is allowed to beplaced) within 3 mm from the reference line. Further, in the mainscanning direction, a non-document-placed region NDR (hatched with apattern of lines inclined downward to the right in FIG. 1B) is definedas a region from the long side, which does not include the referencepoint OP and is opposed to the reference line, of the exposed surface ofthe transparent plate TP to a region where the A3-landscape document DCis allowed to be placed.

The image reader SM further includes a reference member BM fixedlyattached to an upper surface of the transparent plate TP. The referencemember BM is disposed at an end portion (i.e., a left end portion inFIG. 1B) of the transparent plate TP in the sub scanning direction. Thereference member BM is a white member extending along the main scanningdirection. The reference member BM is used to acquire below-mentionedwhite data. Hereinafter, in the sub scanning direction, a position wherethe reference member BM is disposed may be referred to as a “homeposition HP.”

[Control Configuration of Image Reader]

FIG. 2 schematically shows a control configuration of the image readerSM. The image reader SM further includes an operation mechanism OM, adisplay mechanism DM, a reading mechanism RM, and a control unit CU. Theoperation mechanism OM includes a plurality of keys. A user is allowedto operate the operation mechanism OM and input instructions to theimage reader SM. The display mechanism DM includes a display configuredto display various kinds of information. The control unit CU includes acontroller CR and a memory ME. The controller CR includes a processorconfigured to perform various processes (such as processes shown inFIGS. 3 to 6) in accordance with programs PGM stored in the memory ME.

The reading mechanism RM includes a reading unit RU, a moving mechanismMM, an A/D converter AD, and a corrector SC. The moving mechanism MM isconfigured to move the reading unit RU along the sub scanning direction.The A/D converter AD is configured to convert analog data output fromthe reading unit RU, into digital data. The corrector SC is configuredto convert, into gradation values, the digital data generated throughthe conversion by the A/D convertor AD, through shading correction usingbelow-mentioned white data and black data. It is noted that the digitaldata generated through the conversion by the A/D convertor AD is outputto the memory ME and the corrector SC. The digital data output to thememory ME is stored into the memory ME. The gradation values generatedthrough the shading correction by the corrector SC are output to andstored into the memory ME.

[Power-on Process as Main Process]

Subsequently, referring to FIG. 3, an explanation will be provided of apower-on process to be executed by the controller CR. When the imagereader SM is powered on, the controller CR launches a power-on process(M1) as shown in FIG. 3.

When the power-on process (M1) is launched, the controller CR controlsthe moving mechanism MM to move the reading unit RU, and changes thereading position from a position when the image reader SM was poweredoff to the home position HP (T1). Thereby, in the sub scanningdirection, the reading position of the reading unit RU (i.e., a positionof the image sensor IS) is made coincident with the position of thereference member BM.

The controller CR adjusts a light quantity LE for image reading (T2).Specifically, the controller CR controls the light source LS to emitlight towards the reference member BM, and adjusts the light quantity LEof the light emitted by the light source LS in such a manner that analogdata generated when the image sensor IS receives light reflected fromthe reference member BM becomes a maximum value acceptable for the A/Dconverter AD. It is noted that the light quantity LE is determined by alighting time period and an electric current value for light emitting bythe light source LS in one-line image reading.

The controller CR acquires black data BK (T3). Specifically, forinstance, the controller CR turns off the light source LS, controls thereading unit RU to perform one-line image reading, and stores, into thememory ME, digital data generated by the one-line image reading as theblack data BK. At this time, the digital data is dark output.

The controller CR acquires white data WT (T4). Specifically, forinstance, the controller CR turns on and controls the light source LS toemit light of the light quantity LE, controls the reading unit RU toperform one-line image reading, and stores, into the memory ME, digitaldata generated by the one-line image reading as the white data WT.

The controller CR calculates a cover criterion value THco (T5).Specifically, for instance, the controller CR acquires the black data BKfrom the memory ME, and determines a black data maximum value BKmax byextracting a maximum value in the non-document-placed region NDR fromamong the black data BK. Further, the controller CR determines the covercriterion value THco as a value derived from multiplying the black datamaximum value BKmax by 1.1.

The controller CR controls the moving mechanism MM to move the readingunit RU, and changes the reading position from the home position HP tothe A4-landscape position LP (T6). Thereby, in the sub scanningdirection, the reading position of the reading unit RU is changed to aposition corresponding to the opposed side of the A4-landscape documentDC. It is noted that the “position corresponding to the opposed side”denotes a position slightly shifted inward of the document from theopposed side (e.g., a position shifted by 3 mm inward of the documentfrom the opposed side).

The controller CR acquires setting values from the memory ME (T7). Thesetting values include a reading range and a reading resolution. Forinstance, as the reading range in the main scanning direction, a maximumreadable range that makes it possible to read the non-document-placedregion NDR may be set. As the reading resolution, 300 dpi may be set.

The controller CR determines whether ambient light has been detected(T8). Specifically, for instance, the controller CR determines whetherevery piece of digital data of specific pixels in thenon-document-placed region NDR is equal to or higher than the covercriterion value THco. When determining that every piece of digital dataof the specific pixels in the non-document-placed region NDR is equal toor higher than the cover criterion value THco, the controller CRdetermines that ambient light has been detected (T8: Yes), and goes toT9. In T9, the controller CR performs a document size determiningprocess. When determining that every piece of digital data of thespecific pixels in the non-document-placed region NDR is not equal to orhigher than the cover criterion value THco, the controller CR determinesthat ambient light has not been detected (T8: No), and goes to T10. InT10, the controller CR determines whether a reading start button hasbeen pressed. During a period of time when the reading start button isnot pressed (T10: No), the controller CR repeatedly performs theoperation in T8 and always monitors whether ambient light has beendetected. It is noted that the specific pixels in thenon-document-placed region NDR may be all pixels positioned in thenon-document-placed region NDR, or may be a plurality of pixelspositioned close to an end portion of the transparent plate TP that isfar from the reference point OP in the main scanning direction.

The controller CR performs a document size determining process todetermine a document size (T9). As will be described in detail later,the controller CR determines existence/nonexistence of a document, usingdigital data of the margin region MR. Thereafter, the controller CRgenerates acquisition timing to acquire gradation values SZA fordetermining the document size, using digital data of thenon-document-placed region NDR, and determines the document size usingthe gradation values SZA acquired with the generated acquisition timing.

The controller CR determines whether the reading start button has beenpressed (T10). When determining that the reading start button has beenpressed (T10: Yes), the controller CR goes to T11 and performs a readingprocess. Meanwhile, when determining that the reading start button hasnot been pressed (T10: No), the controller CR goes back to T8 anddetermines whether ambient light has been detected.

The controller CR controls the reading unit RU to perform image reading(T11). As will be described in detail later, the controller CR sets areading range in conformity to the document size determined in thedocument size determining process (T9), and controls the reading unit RUto perform image reading while controlling the moving mechanism MM.

[Document Size Determining Process]

Referring to FIGS. 4A and 4B, the document size determining process (T9)will be described. The document size determining process (T9) isperformed in response to the determination in T8 that ambient light hasbeen detected (T8: Yes). Namely, the document size determining process(T9) is started when the document cover CV is opened and ambient lightis incident into the reading unit RU staying in the A4-landscapeposition LP.

In the document size determining process, the controller CR performslighting control for the light source LS (TA1). Specifically, forinstance, the controller CR performs the lighting control with two lines(i.e., a turn-on line and a turn-off line) as one reading line for imagereading in the main scanning direction. In the turn-on line, the lightsource LS is controlled to emit light of the light quantity LE. In theturn-off line, the light source LS is turned off. In the illustrativeembodiment, a case where the turn-on line is a single line will bedescribed. Nonetheless, the light source LS may be configured tosequentially emit red light, green light, and blue light. In this case,the turn-on line may include three lines illuminated with the red light,the green light, and the blue light, respectively.

The controller CR determines whether a document has been detected in themargin region MR (TA2). Namely, with respect to each of specific pixelsin the margin region MR, the controller CR determines whether adifference between digital data of the turn-on line and digital data ofthe turn-off line is equal to or lower than a document criterion value.When determining that the difference between digital data of the turn-online and digital data of the turn-off line is equal to or lower than thedocument criterion value, the controller CR determines that a documenthas not been detected in the margin region MR (TA2: No), and goes toTA3. In TA3, the controller CR determines whether a predetermined periodof time has elapsed. Meanwhile, when determining that the differencebetween digital data of the turn-on line and digital data of theturn-off line is higher than the document criterion value, thecontroller CR determines that a document has been detected in the marginregion MR (TA2: Yes), and goes to TA4. In TA4, the controller CRdetermines whether the document has been detected in thenon-document-placed region NDR. Until the predetermined period of timehas elapsed (i.e., while making a negative determination in TA3 (TA3:No)), the controller CR repeatedly performs the operation in TA2 andalways monitors whether a document has been detected in the marginregion MR. It is noted that the document criterion value, which is usedfor determination as to whether a document has been detected in themargin region MR, needs to be set larger than a fluctuation amount ofrandom noises superimposed on the analog data. Further, the specificpixels in the margin region MR may be all pixels positioned in themargin region MR, or may be a plurality of pixels positioned at an endportion of the transparent plate TP that is close to the reference pointOP in the main scanning direction.

The controller CR determines whether the predetermined period of timehas elapsed (TA3). When determining that the predetermined period oftime has elapsed (TA3: Yes), the controller CR goes to TA11, anddetermines whether the document cover CV is closed. Meanwhile, whendetermining that the predetermined period of time has not elapsed (TA3:No), the controller CR goes back to TA2, and determines whether adocument has been detected in the margin region MR.

The controller CR determines whether the document has been detected inthe non-document-placed region NDR (TA4). Namely, with respect to eachof the specific pixels in the non-document-placed region NDR, thecontroller CR determines whether a difference between digital data ofthe turn-on line and digital data of the turn-off line is equal to orlower than the document criterion value. When determining that thedifference between digital data of the turn-on line and digital data ofthe turn-off line is equal to or lower than the document criterionvalue, the controller CR determines that the document has not beendetected in the non-document-placed region NDR (TA4: No), and goes toTA5. In TA5, the controller CR determines whether every piece of digitaldata of the specific pixels in the non-document-placed region NDR of theturn-off line is equal to or lower than the cover criterion value THco.Meanwhile, when determining that the difference between digital data ofthe turn-on line and digital data of the turn-off line is higher thanthe document criterion value, the controller CR determines that thedocument has been detected in the non-document-placed region NDR (TA4:Yes), and goes to TA7. In TA7, the controller CR determines the documentsize to be an A3-landscape size. When a document has been detected inthe non-document-placed region NDR, the document size is determined tobe the A3-landscape size as a maximum readable size.

The controller CR determines whether every piece of digital data ofspecific pixels in the non-document-placed region NDR of the turn-offline is equal to or lower than the cover criterion value THco (TA5).When determining that every piece of digital data of specific pixels inthe non-document-placed region NDR of the turn-off line is equal to orlower than the cover criterion value THco (TA5: Yes), the controller CRdetermines that the document cover CV is in a state immediately beforethe document cover CV is brought into a closed state, and goes to TA8.In TA8, the controller CR executes a line data acquiring operation. Whendetermining that every piece of digital data of specific pixels in thenon-document-placed region NDR of the turn-off line is higher than thecover criterion value THco (TA5: No), the controller CR determines thatthe document cover CV is in an open state, and goes to TA6. In TA6, thecontroller CR determines whether a predetermined period of time haselapsed. Until the predetermined period of time has elapsed (i.e., whilemaking a negative determination in TA6 (TA6: No)), the controller CRrepeatedly performs the operation in TA5 and always monitors theopen/closed state of the document cover CV. It is noted that a point oftime “immediately before the document cover CV is brought into theclosed state” is the acquisition timing to acquire the gradation valuesSZA for determining the document size.

The controller CR determines whether a predetermined period of time haselapsed (TA6). When determining that the predetermined period of timehas elapsed (TA6: Yes), the controller CR goes to TA7 and determines thedocument size to be the A3-landscape size. When determining that thepredetermined period of time has not elapsed (TA6: No), the controllerCR goes back to TA5. Namely, when every piece of digital data ofspecific pixels in the non-document-placed region NDR of the turn-offline is not equal to or lower than the cover criterion value THco (TA5:No) even after the predetermined period of time has elapsed (TA6: Yes),the controller CR determines that the document cover CV is in the openstate, and determines the document size to be the A3-landscape size(TA7).

The controller CR determines the document size to be the A3-landscapesize (TA7).

The controller CR acquires the gradation values SZA of a single turn-online in the state immediately before the document cover CV is broughtinto the closed state (TA8).

The controller CR calculates a first threshold value SZ1 (TA9).Specifically, for instance, the controller CR determines, as the firstthreshold value SZ1, an average value between a gradation value BL1 anda gradation value NO1. The gradation value BL1 represents anintermediate value, in the margin region MR, of the gradation values SZAacquired in TA8. The gradation value NO1 represents an intermediatevalue, in the non-document-placed region NDR, of the gradation valuesSZA acquired in TA8. The “intermediate value” indicates a gradationvalue of a pixel positioned in a middle of all pixels in a specifiedregion that are arranged in ascending order of gradation values. Thegradation value BL1 is defined as the intermediate value, in the marginregion MR, of the gradation values SZA. Nonetheless, the gradation valueBL1 may be defined as an average value of gradation values of all thepixels in the margin region MR. Further, the gradation value NO1 may bedefined as an average value of gradation values of all the pixels in thenon-document-placed region NDR.

The controller CR determines the document size (TA10). Specifically, forinstance, the controller CR determines, as a document end portion, aposition of a pixel that is closest to the non-document-placed regionNDR among pixels that indicate gradation values lower than the firstthreshold value SZ1 among the gradation values SZA of a single turn-online. The controller CR determines, as a document size in the mainscanning direction, a distance between the reference line passingthrough the reference point OP in the sub scanning direction and thedocument end portion. The controller CR determines the document size,based on the determined document size in the main scanning direction andthe determination that the document size in the sub scanning directionis equal to or more than the A4-landscape size. In this respect,nonetheless, when the determined document size in the main scanningdirection is different from standardized sheet sizes, the controller CRdetermines the document size in the sub scanning direction to be theA3-landscape size. Thus, since the document size is determined using thegradation values SZA in the A4-landscape position LP, it is possible todetermine more document sizes than when the document size is detected inan A3-landscape position.

The controller CR determines whether the document cover CV is in theclosed state (TA11). Namely, the controller CR determines whether everypiece of digital data of the specific pixels in the non-document-placedregion NDR of the turn-off line is equal to or lower than the covercriterion value THco. When determining that every piece of digital dataof the specific pixels in the non-document-placed region NDR of theturn-off line is equal to or lower than the cover criterion value THco(TA11: Yes), the controller CR determines that the document cover CV isin the closed state, and goes to TA12. In TA12, the controller CRperforms a document size redetermining process. When determining thatevery piece of digital data of the specific pixels in thenon-document-placed region NDR of the turn-off line is higher than thecover criterion value THco (TA11: No), the controller CR determines thatthe document cover CV is in the open state, and goes to TA7. In TA7, thecontroller CR determines the document size to be the A3-landscape size.

The controller CR changes the reading position from the A4-landscapeposition LP to the reference position BP, and determines the documentsize (TA12). As will be described in detail later, the controller CRdetermines whether it is possible to calculate a threshold value fordetermining the document size without having to open the document coverCV. When determining that it is not possible to determine the documentsize without having to open the document cover CV, the controller CRdisplays instructions to prompt the user to open and close the documentcover CV. In response to the user opening and closing the document coverCV, the controller CR determines the document size.

The controller CR sets a cover-closed flag ON (TA13). Namely, thecontroller CR sets ON the cover-closed flag stored in the memory ME.

The controller CR sets the cover-closed flag OFF (TA14). Namely, thecontroller CR sets OFF the cover-closed flag stored in the memory ME.

[Document Size Redetermining Process]

Referring to FIGS. 5A and 5B, the document size redetermining process(TA12) will be described. The document size redetermining process (TA12)is launched when a document has not been detected in the margin regionMR in the A4-landscape position LP as the reading position (TA2: No) andthe document cover CV is in the closed state (TA11: Yes). Thus, thedocument size redetermining process (TA12) is launched when the documentsize in the sub scanning direction is less than the A4-landscape size.

The controller CR controls the moving mechanism MM to move the readingunit RU and changes the reading position from the A4-landscape positionLP to the reference position BP (TB1). Thereby, in the sub scanningdirection, the reading position of the reading unit RU becomes aposition corresponding to the reference side of the document. It isnoted that the “position corresponding to the reference side” denotes aposition slightly shifted inward of the document from the reference side(e.g., a position shifted by 3 mm inward of the document from thereference side).

The controller CR acquires gradation values SZB of a single turn-online. Namely, the controller CR acquires the gradation values SZB of asingle turn-on line when the document cover CV is in the closed state(TB2).

The controller CR determines whether it is possible to calculate asecond threshold value SZ2 for determining the document size (TB3).Specifically, for instance, the controller CR calculates a differencebetween a gradation value BL2 and a gradation value NO2. The gradationvalue BL2 represents an intermediate value, in the margin region MR, ofthe gradation values SZB. The gradation value NO2 represents anintermediate value, in the non-document-placed region NDR, of thegradation values SZB. The “intermediate value” indicates a gradationvalue of a pixel positioned in a middle of all pixels in a specifiedregion that are arranged in ascending order of gradation values. Whenthe calculated difference is equal to or more than a predeterminedvalue, the controller CR determines that it is possible to calculate thesecond threshold value SZ2 (TB3: Yes), and goes to TB4. In TB4, thecontroller CR calculates the second threshold value SZ2. When thecalculated difference is less than the predetermined value, thecontroller CR determines that it is not possible to calculate the secondthreshold value SZ2 (TB3: No), and goes to TB6. In TB6, the controllerCR executes a cover-open display operation. For instance, thepredetermined value may be set to 5% of a difference between a whitelevel and a black level.

In the same manner as executed in TA9, the controller CR calculates anaverage value between the gradation value BL2 and the gradation valueNO2, and sets the calculated average value to the second threshold valueSZ2 (TB4). As described above, in the illustrative embodiment, thegradation value BL2 is the intermediate value, in the margin region MR,of the gradation values SZB. Nonetheless, the gradation value BL2 may bean average value of all the pixels in the margin region MR. Likewise,the gradation value NO2 may be an average value of all the pixels in thenon-document-placed region NDR.

The controller CR determines the document size (TB5). Specifically, forinstance, the controller CR determines, as a document end portion, aposition of a pixel that is closest to the non-document-placed regionNDR among pixels that indicate gradation values lower than the secondthreshold value SZ2 among the gradation values SZB of a single turn-online. The controller CR determines, as a document size in the mainscanning direction, a distance between the reference line and thedocument end portion. The controller CR determines the document size,based on the determined document size in the main scanning direction andthe determination that the document size in the sub scanning directionis less than the A4-landscape size. In this respect, nonetheless, whenthe determined document size in the main scanning direction is differentfrom the standardized sheet sizes, the controller CR determines thedocument size in the sub scanning direction to be the A3-landscape size.

The controller CR controls the display mechanism DM to display a coveropening instruction to prompt the user to open the document cover CV(TB6).

The controller CR determines whether ambient light has been detected(TB7). Specifically, for instance, the controller CR determines whetherevery piece of digital data of specific pixels in thenon-document-placed region NDR is equal to or higher than the covercriterion value THco. When determining that every piece of digital dataof specific pixels in the non-document-placed region NDR is equal to orhigher than the cover criterion value THco, the controller CR determinesthat ambient light has been detected (TB7: Yes), and goes to TB10. InTB10, the controller CR controls the display mechanism DM to display acover closing instruction to prompt the user to close the document coverCV. When determining that every piece of digital data of specific pixelsin the non-document-placed region NDR is lower than the cover criterionvalue THco, the controller CR determines that ambient light has not beendetected (TB7: No), and goes to TB8.

In TB8, the controller CR determines whether a predetermined period oftime has elapsed. When determining that the predetermined period of timehas elapsed (TB8: Yes), the controller CR goes to TB9 and determines thedocument size to be the A3-landscape size. When determining that thepredetermined period of time has not elapsed (TB8: No), the controllerCR goes back to TB7. When determining in TB7 that ambient light has notbeen detected (TB7: No) and determining in TB8 that the predeterminedperiod of time has elapsed (TB8: Yes), the controller CR determines thatthe document cover CV is not open, and goes to TB9.

In TB9, the controller CR determines the document size to be theA3-landscape size.

The controller CR controls the display mechanism DM to display a coverclosing instruction to prompt the user to close the document cover CV(TB10).

The controller CR determines whether every piece of digital data ofspecific pixels in the non-document-placed region NDR of the turn-offline is equal to or lower than the cover criterion value THco (TB11).When determining that every piece of digital data of specific pixels inthe non-document-placed region NDR of the turn-off line is equal to orlower than the cover criterion value THco (TB11: Yes), the controller CRdetermines that the document cover CV is in a state immediately beforethe document cover CV is brought into the closed state, and goes toTB13. In TB13, the controller CR executes a line data acquiringoperation. When determining that every piece of digital data of specificpixels in the non-document-placed region NDR of the turn-off line ishigher than the cover criterion value THco (TB11: No), the controller CRdetermines that the document cover CV is in the open state, and goes toTB12. In TB12, the controller CR determines whether a predeterminedperiod of time has elapsed. It is noted that a point of time“immediately before the document cover CV is brought into the closedstate” is acquisition timing to acquire gradation values for determiningthe document size. When determining in TB12 that the predeterminedperiod of time has elapsed (TB12: Yes), the controller CR determinesthat the document cover CV remains in the open state, and goes to TB9.In TB9, the controller CR determines the document size to be theA3-landscape size.

A line data acquiring operation (TB13), a threshold value calculatingoperation (TB14), and a document size determining operation (TB15) aresubstantially the same as the operations in TAB, TA9, and TA10,respectively. Therefore, explanations of the operations in TB13, TB14,and TB15 will be omitted. By the operations in TB13, TB14, and TB15, thedocument size is determined.

[Reading Process]

Referring to FIGS. 6A and 6B, the reading process (T11) will bedescribed. The reading process (T11) is launched when the controller CRdetermines in T10 that the reading start button has been pressed (T10:Yes).

The controller CR sets a reading range (TC1). Specifically, forinstance, when the document size has been determined in the documentsize determining process (T9), the controller CR sets the determineddocument size as a reading range. When the document size determiningprocess (T9) has not been performed, and the document size has not beendetermined, the controller CR sets the reading range to the A3-landscapesize.

The controller CR acquires setting values for image reading from thememory ME (TC2). For instance, the setting values include a readingresolution. The controller CR sets the reading resolution to 300 dpi.

The controller CR determines whether the cover-closed flag is set ON(TC3). When determining that the cover-closed flag is set ON (TC3: Yes),the controller CR goes to TC8. In TC8, the controller CR determineswhether the reading range in the sub scanning direction is equal to ormore than the A4 size. Meanwhile, when determining that the cover-closedflag is set OFF (TC3: No), the controller CR goes to TC4. In TC4, thecontroller CR changes the reading position to the home position HP.

The controller CR controls the moving mechanism MM to move the readingunit RU and changes the reading position to the home position HP (TC4).Thereby, in the sub scanning direction, the reading position of thereading unit RU is set to the home position HP to face the referencemember BM.

The controller CR acquires white data and black data (TC5).Specifically, for instance, the controller CR turns off the light sourceLS, controls the reading unit RU to perform one-line image reading, andstores, into the memory ME, digital data generated by the one-line imagereading as black data BK. Further, the controller CR turns on andcontrols the light source LS to emit light of the light quantity LE,controls the reading unit RU to perform one-line image reading, andstores, into the memory ME, digital data generated by the one-line imagereading as white data WT.

The controller CR controls the moving mechanism MM to move the readingunit RU and changes the reading position from the home position HP tothe reference position BP (TC6). Thereby, in the sub scanning direction,the reading position of the reading unit RU is set to a positioncorresponding to the reference side of the document. It is noted thatthe “position corresponding to the reference side” denotes a positionslightly shifted inward of the document from the reference side (e.g., aposition shifted by 3 mm inward of the document from the referenceside).

The controller CR controls the reading unit RU to move in a forwarddirection and perform image reading (TC7). Specifically, for instance,the controller CR controls the moving mechanism MM to move the readingunit RU over the reading range set in TC1 from the reference positionBP, and controls the reading unit RU to generate image data of gradationvalues. It is noted that the “forward direction” denotes such adirection as to become farther away from the reference point OP alongthe sub scanning direction.

The controller CR determines whether the reading range in the subscanning direction is equal to or more than the A4-landscape size (TC8).When determining that the reading range in the sub scanning direction isequal to or more than the A4-landscape size (TC8: Yes), the controllerCR goes to TC10. In TC10, the controller CR moves the reading positionto a reading start position. Meanwhile, when determining that thereading range in the sub scanning direction is less than theA4-landscape size (TC8: No), the controller CR goes to TC9. In TC9, thecontroller CR performs a black data acquiring operation.

The controller CR acquires black data (TC9). Specifically, for instance,the controller CR turns off the light source LS, controls the readingunit RU to perform one-line image reading, and stores, into the memoryME, digital data generated by the one-line image reading as the blackdata BK. After the black data acquiring operation (TC9), the controllerCR goes to TC7 and executes the forward-direction reading operation.

The controller CR controls the moving mechanism MM to move the readingunit RU and changes the reading position to the reading start position(TC10). Specifically, for instance, the controller CR changes thereading position to the reading start position as a positioncorresponding to the opposed side of the document that corresponds tothe reading range set in TC1. When the document cover CV is in theclosed state, and the document size in the sub scanning direction isdetermined to be equal to or more than the A4-landscape size, thedocument size is determined with the reading position as theA4-landscape position LP. Hence, it is possible to start image readingfrom the opposed side of the document that is positioned within a shortmoving distance from the A4-landscape position LP. Thus, it is possibleto start image reading more quickly.

The controller CR acquires black data (TC11). Specifically, forinstance, the controller CR turns off the light source LS, controls thereading unit RU to perform one-line image reading, and stores, into thememory ME, digital data generated by the one-line image reading as theblack data BK.

The controller CR controls the reading unit RU to move in a backwarddirection and perform image reading (TC12). Specifically, the controllerCR controls the moving mechanism MM to move the reading unit RU from thereading start position, which is the opposed side of the document, tothe reference position BP, and controls the reading unit RU to generateimage data of gradation values. It is noted that the “backwarddirection” denotes such a direction as to become closer to the referencepoint OP along the sub scanning direction.

The controller CR inverts the original image data generated in TC12(TC13). Specifically, for instance, the controller CR performs a linereplacement operation such that a final line of the original image databecomes a leading line of the inverted image data and that a leadingline of the original image data becomes a final line of the invertedimage data.

[Specific Examples of Digital Data and Gradation Values in Each CoverState]

Referring to FIGS. 7 and 8, a specific explanation will be provided ofan example in which a document of the A3-landscape size is placed on thetransparent plate TP. In the illustrative embodiment, the followingexplanation will be provided under an assumption that high-intensityambient light is incident to the reading unit RU, and the document has abackground color that is slightly darker than white of the referencemember BM and has such a thickness as to prevent light transmissionthrough the document. Further, in the following example, the document ofthe A3-landscape size is placed. Therefore, the document is not placedon the non-document-placed region NDR but placed on the other region.When the document cover CV is in the closed state, the document cover CVis completely closed, and ambient light has no influence on imagereading for the document.

Each of FIGS. 7A to 7E shows a relationship between the position in themain scanning direction (hereinafter, which may be referred to as a“main scanning position”) and digital data in a corresponding state ofthe document cover CV. The digital data is a value of an output signalfrom the A/D convertor AD. FIG. 7A shows a state where the documentcover CV is closed, and the document is not placed on the transparentplate TP. FIG. 7B shows a state where the document cover CV is open, andthe document is not placed. FIG. 7C shows a state where the documentcover CV is open, and the document is placed. FIG. 7D shows a stateimmediately before the document cover CV is brought into the closedstate, with the document placed. FIG. 7E shows a state where thedocument cover CV is closed, and the document is placed. Further, aleftmost section (1) of each of FIGS. 7A to 7E is a side view of theimage reader SM from the left in FIG. 1A. A middle section (2) of eachof FIGS. 7A to 7E shows a relationship between the main scanningposition and the digital data when the light source LS is emitting lightof the light quantity LE. A rightmost section (3) of each of FIGS. 7A to7E shows a relationship between the main scanning position and thedigital data when the light source LS is turned off. In FIGS. 7A to 7Eand FIGS. 8A to 8E, each alternate long and two short dashed lineindicates a boundary of the margin region MR or a boundary of thenon-document-placed region NDR with respect to the main scanningposition. More specifically, with respect to the main scanning position,the margin region MR is identified between a leading pixel position andthe alternate long and two short dashed line that is closer to theleading pixel position. The non-document-placed region NDR is identifiedbetween a final pixel position and the alternate long and two shortdashed line that is closer to the final pixel position.

Each of FIGS. 8A to 8E shows a relationship between the main scanningposition and a gradation value in a corresponding cover state. Thegradation value is a value of an output signal from the corrector SC.FIG. 8A shows the state where the document cover CV is closed, and thedocument is not placed. FIG. 8B shows the state where the document coverCV is open, and the document is not placed. FIG. 8C shows the statewhere the document cover CV is open, and the document is placed. FIG. 8Dshows the state immediately before the document cover CV is brought intothe closed state, with the document placed. FIG. 8E shows a state wherethe document cover CV is closed, and the document is placed. Further, aleftmost section (1) of each of FIGS. 8A to 8E is a side view of theimage reader SM from the left in FIG. 1A. A middle section (2) of eachof FIGS. 8A to 8E shows a relationship between the main scanningposition and the gradation value when the light source LS is emittinglight of the light quantity LE. A rightmost section (3) of each of FIGS.8A to 8E shows a relationship between the main scanning position and thegradation value when the light source LS is turned off.

An explanation will be provided of output results of the digital dataand the gradation value in each cover state, with reference to FIGS. 7Ato 7E and 8A to 8E.

In the state where the document cover CV is closed without the documentplaced on the transparent plate TP (see FIGS. 7A and 8A), the documentcover CV is closed relative to the main body MB, and thus the readingunit RU is not affected by ambient light. Further, the document is notplaced on the image reader SM. Hence, the reading unit RU reads adownward-facing surface (white) of the document cover CV. Therefore,when the light source LS is turned on, and image reading is performed,as shown in the middle section (2) of FIG. 7A, the digital data is ashigh as output levels when the reading unit RU reads the referencemember BM. Further, as shown in the middle section (2) of FIG. 8A, thegradation value is as high as a maximum value representing the whitecolor. When the light source LS is turned off, and image reading isperformed, as shown in the rightmost section (3) of FIG. 7A, the digitaldata is as low as a dark output level. Further, as shown in therightmost section (3) of FIG. 8A, the gradation value is as low as aminimum value representing the black color.

In the state where the document cover CV is open without the documentplaced on the transparent plate TP (see FIGS. 7B and 8B), the documentcover CV is open relative to the main body MB, and thus the reading unitRU is affected by ambient light. Further, the document is not placed onthe image reader SM. Hence, the reading unit RU is affected by ambientlight over an entire region thereof in the main scanning direction.Therefore, when the light source LS is turned on, and image reading isperformed, as shown in the middle section (2) of FIG. 7B, the digitaldata has higher values than when the reading unit RU reads the referencemember BM, due to influence of ambient light. Further, as shown in themiddle section (2) of FIG. 8B, the gradation value is as high as themaximum value representing the white color. When the light source LS isturned off, and image reading is performed, as shown in the rightmostsection (3) of FIG. 7B, the digital data has higher values than when thereading unit RU reads the reference member BM, due to influence ofambient light. Further, as shown in the rightmost section (3) of FIG.8B, the gradation value is as high as the maximum value representing thewhite color.

In the illustrative embodiment, in the respective steps T8 and TB7 fordetermining whether ambient light has been detected, of the power-onprocess (M1) and the document size redetermining process (TA12), thecontroller CR determines whether the document cover CV is open, based onthe determination as to whether the digital data in thenon-document-placed region NDR when the light source LS is turned off isequal to or higher than the cover criterion value THco. Namely, as shownin the rightmost section (3) of FIG. 7A, in the state where the documentcover CV is closed without the document placed on the transparent plateTP, the digital data in the non-document-placed region NDR is lower thanthe cover criterion value THco. Further, as shown in the rightmostsection (3) of FIG. 7B, in the state where the document cover CV is openwithout the document placed on the transparent plate TP, the digitaldata in the non-document-placed region NDR is higher than the covercriterion value THco. By using the change in value of the digital data,it is possible to detect the open state of the document cover CV.

In the state where the document cover CV is open with the documentplaced on the transparent plate TP (see FIGS. 7C and 8C), the documentcover CV is open relative to the main body MB, and thus the reading unitRU is affected by ambient light. Further, the document is placed on theimage reader SM. Hence, the reading unit RU is affected by ambient lightin the non-document-placed region NDR, while the reading unit RU is notaffected by ambient light in the other region. Therefore, when the lightsource LS is turned on, and image reading is performed, as shown in themiddle section (2) of FIG. 7C, the digital data in thenon-document-placed region NDR has higher values than when the readingunit RU reads the reference member BM, due to influence of ambientlight, while the digital data in the other region has output valuescorresponding to the background color. Further, as shown in the middlesection (2) of FIG. 8C, the gradation values in the non-document-placedregion NDR are as high as the maximum value representing the whitecolor, while the gradation values in the other region are as high as avalue representing the background color. When the light source LS isturned off, and image reading is performed, as shown in the rightmostsection (3) of FIG. 7C, the digital data in the non-document-placedregion NDR has high values than when the reading unit RU reads thereference member BM, due to influence of ambient light, while thedigital data in the other region is as low as the dark output level.Further, as shown in the rightmost section (3) of FIG. 8C, the gradationvalues in the non-document-placed region NDR are as high as the maximumvalue representing the white color, while the gradation values in theother region are as low as the minimum value representing the blackcolor.

In the illustrative embodiment, in the step TA2 of the document sizedetermining process (T9), the controller CR determines whether adocument has been detected in the margin region MR, using digital datain the margin region MR when the light source LS is caused to emit lightof the light quantity LE and when the light source LS is turned off.Namely, in the margin region MR in the state where the document cover CVis open without the document placed on the transparent plate TP, thedifference between the digital data when the light source LS is turnedoff and the digital data when the light source LS is turned on isequivalent to zero as indicated by a dashed line in the middle section(2) of FIG. 7B. Meanwhile, in the margin region MR in the state wherethe document cover CV is open with the document placed on thetransparent plate TP, the difference between the digital data when thelight source LS is turned off and the digital data when the light sourceLS is turned on is higher than the document criterion value as indicatedby a dashed line in the middle section (2) of FIG. 7C. By using thechange in value of the digital data, it is possible to detect thedocument.

Unlike the other states, the state immediately before the document coverCV is brought into the closed state with the document placed on thetransparent plate TP (see FIGS. 7D and 8D) is a state where, when thelight source LS is turned off, and image reading is performed, thedigital data in the non-document-placed region NDR is equal to or lowerthan the cover criterion value THco. When the light source LS is turnedoff, and image reading is performed, in the state where the documentcover CV is open with the document placed on the transparent plate TP(see FIGS. 7C and 8C), the digital data in the non-document-placedregion NDR is affected by ambient light and has high values (see therightmost section (3) of FIG. 7C). Meanwhile, in the state where thedocument cover CV is closed with the document placed on the transparentplate TP (see FIGS. 7E and 8E), the digital data in thenon-document-placed region NDR is not affected by ambient light and isas low as the dark output level (see the rightmost section (3) of FIG.7E). In the meantime, the cover criterion value THco is determined as avalue derived from multiplying the black data maximum value BKmax by 1.1(T5), and is substantially as low as the black data BK. Therefore, thestate where the digital data in the non-document-placed region NDR isequal to or lower than the cover criterion value THco is a state wherethe digital data in the non-document-placed region NDR is hardlyaffected by ambient light, and is regarded as a state immediately beforethe document cover CV is brought into the closed state.

In the state immediately before the document cover CV is brought intothe closed state with the document placed on the transparent plate TP(see FIGS. 7D and 8D), when the light source LS is turned on, and imagereading is performed, as shown in the middle section (2) of FIG. 7D, thedigital data in the non-document-placed region NDR has values around thecover criterion value THco, while the digital data in the other regionhas output values substantially corresponding to the background color.Further, as shown in the middle section (2) of FIG. 8D, the gradationvalues in the non-document-placed region NDR are around the correctedcover criterion value THco, while the gradation values in the other areaare as high as the value representing the background color. When thelight source LS is turned off, and image reading is performed, as shownin the rightmost section (3) of FIG. 7D, the digital data in thenon-document-placed region NDR has values around the cover criterionvalue THco, while the digital data in the other region is as low as thedark output level. As shown in the rightmost section (3) of FIG. 8D, thegradation values in the non-document-placed region NDR are around thecorrected cover criterion value THco, while the gradation values in theother region are as low as the minimum value representing the blackcolor.

In the illustrative embodiment, in the respective steps TA5 and TB11 ofthe document size determining process (T9) and the document sizeredetermining process (TA15), the controller CR determines whether everypiece of digital data of the specific pixels in the non-document-placedregion NDR of the turn-off line is equal to or lower than the covercriterion value THco. As shown in the rightmost section (3) of FIG. 7C,in the state where the document cover CV is open, the digital data inthe non-document-placed region NDR has higher values than when thereading unit RU reads the reference member BM, due to influence ofambient light. As shown in the middle section (3) of FIG. 7D, in thestate immediately before the document cover CV is brought into theclosed state, the digital data in the non-document-placed region NDR isless likely to be affected by ambient light, and has values around thecover criterion value THco. Namely, the digital data in thenon-document-placed region NDR changes depending on the open/closedstate of the document cover CV. By using the change, it is possible todetect the state immediately before the document cover CV is broughtinto the closed state.

In the illustrative embodiment, in the respective steps TA10 and TB15 ofthe document size determining process (T9) and the document sizeredetermining process (TA12), the controller CR determines the documentsize in the main scanning direction, using the gradation values when thelight source LS is caused to emit light of the light quantity LE. Asshown in the middle section (2) of FIG. 8D, when the light source LS isturned on, and image reading is performed, the gradation values in thenon-document-placed region NDR are as high as the minimum valuerepresenting the black color, while the gradation values in the otherregion (i.e., a document-placed region) where the document is placed arebased on the read data of the document. The end portion of the documentopposed to the reference line in the main scanning direction ispositioned closest to the non-document-placed region NDR within a rangein which the gradation values are higher than the first threshold valueSZ1, which is determined based on the gradation values in the marginregion MR and the gradation values in the non-document-placed regionNDR. In the illustrative embodiment, the boundary of thenon-document-placed region NDR (i.e., the boundary between thedocument-placed region and the non-document-placed region NDR) is theend portion of the document opposed to the reference line in the mainscanning direction. Thus, by using the gradation values, it is possibleto suppress dispersion of the digital data and accurately identify theend portion of the document. It is noted that the “dispersion of thedigital data” denotes that the digital data may include different pixelvalues expressing the same gradation.

In the state where the document cover CV is closed with the documentplaced on the transparent plate TP (see FIGS. 7E and 8E), the documentcover CV is closed relative to the main body MB, and thus the readingunit RU is affected by ambient light. Further, the document is placed onthe image reader SM. Hence, the reading unit RU reads the document inthe document-placed region where the document is placed, while thereading unit RU reads the white downward-facing surface of the documentcover CV in the non-document-placed region NDR where the document is notplaced. Therefore, when the light source LS is turned on, and imagereading is performed, as shown in the middle section (2) of FIG. 7E, thedigital data in the non-document-placed region NDR has output valuescorresponding to the white color, while the digital data in the otherregion has output values corresponding to the background color. Further,as shown in the middle section (2) of FIG. 8E, the gradation values inthe non-document-placed region NDR are as high as the maximum valuerepresenting the white color, while the gradation values in the otherregion are as high as the value representing the background color. Whenthe light source LS is turned off, and image reading is performed, asshown in the rightmost section (3) of FIG. 7E, the digital data is aslow as the dark output level. Further, as shown in the rightmost section(3) of FIG. 8E, the gradation values are as low as the minimum valuerepresenting the black color.

In the illustrative embodiment, in the step TA11 for determining whetherthe document cover CV is in the closed state, of the document sizedetermining process (T9), the controller CR determines whether everypiece of digital data of the specific pixels in the non-document-placedregion NDR of the turn-off line is equal to or lower than the covercriterion value THco. As shown in the rightmost section (3) of FIG. 7E,in the state where the document cover CV is closed with the documentplaced on the transparent plate TP, the digital data in thenon-document-placed region NDR is lower than the cover criterion valueTHco. By using the digital data, it is possible to detect the closedstate of the document cover CV.

Advantageous Effects of Illustrative Embodiment

In the illustrative embodiment, in the document size determining process(T9), the determination in TA5 is repeatedly made until thepredetermined period of time has elapsed (TA6: No). In TA5, thecontroller CR determines whether every piece of digital data of thespecific pixels in the non-document-placed region NDR of the turn-offline is equal to or lower than the cover criterion value THco. Hence, byrepeatedly making the determination in TA5, it is possible to detect theopen/closed state of the document cover CV even when the predeterminedperiod of time has not elapsed, and to quickly detect a change in thestate of the document cover CV. Consequently, it is possible togenerate, as the acquisition timing, a point of time immediately beforethe document cover CV is brought into the closed state.

In the illustrative embodiment, after changing the reading position tothe A4-landscape position LP in T6 of the power-on process (M1), thecontroller CR determines whether every piece of digital data of thespecific pixels in the non-document-placed region NDR of the turn-offline is equal to or lower than the cover criterion value THco, in TA5 ofthe document size determining process (T9). Thus, since the readingposition is sufficiently away from the end portion of the transparentplate TP in the sub scanning direction, ambient light is hardly affectedby the main body MB, but is blocked by the document cover CV.Consequently, it is possible to accurately detect the open/closed stateof the document cover CV.

Hereinabove, the illustrative embodiment according to aspects of thepresent disclosure has been described. The present disclosure can bepracticed by employing conventional materials, methodology andequipment. Accordingly, the details of such materials, equipment andmethodology are not set forth herein in detail. In the previousdescriptions, numerous specific details are set forth, such as specificmaterials, structures, chemicals, processes, etc., in order to provide athorough understanding of the present disclosure. However, it should berecognized that the present disclosure can be practiced withoutreapportioning to the details specifically set forth. In otherinstances, well known processing structures have not been described indetail, in order not to unnecessarily obscure the present disclosure.

Only an exemplary illustrative embodiment of the present disclosure andbut a few examples of their versatility are shown and described in thepresent disclosure. It is to be understood that the present disclosureis capable of use in various other combinations and environments and iscapable of changes or modifications within the scope of the inventiveconcept as expressed herein. For instance, according to aspects of thepresent disclosure, the following modifications are possible.

MODIFICATION

(1) The reading mechanism RM may be configured without the CIS. Forinstance, the reading mechanism RM may include a charge coupled device(hereinafter referred to as a “CCD”) fixedly disposed and a movablemirror. In this case, the reading position is not a position of the CCDbut a position of the mirror.

(2) In the aforementioned illustrative embodiment, the controller CRdetermines the state of the document cover CV, using the digital data inthe A4-landscape position LP (TA5: Yes). Nonetheless, the controller CRmay determine the state of the document cover CV using digital data inany position where the reading unit RU is allowed to detect ambientlight.

(3) In the aforementioned illustrative embodiment, the controller CRdetermines the state of the document cover CV, using the digital data(TA5: Yes). Nonetheless, the controller CR may determine the state ofthe document cover CV, using the gradation values, instead of thedigital data.

(4) In the aforementioned illustrative embodiment, the controller CRdetermines the document size, using the gradation values (TA10).Nonetheless, the controller CR may determine the document size, usingthe digital data, instead of the gradation values.

(5) In the aforementioned illustrative embodiment, after determining thestate of the document cover CV (TA5: Yes), the controller CR determinesthe document size (TA10). Nonetheless, the controller CR may perform aninitialization process for the reading process, after detecting thestate of the document cover CV.

(6) In the aforementioned illustrative embodiment, the controller CRdetermines the state of the document cover CV, using the digital data inthe non-document-placed region NDR (TA5: Yes). Nonetheless, thecontroller CR may determine the state of the document cover CV, usingdigital data in any region where the document is not placed, instead ofthe digital data in the non-document-placed region NDR.

(7) In the aforementioned illustrative embodiment, the cover criterionvalue THco is derived from multiplying by 1.1 the black data maximumvalue BKmax that is the maximum value in the non-document-placed regionNDR among the black data BK. Nonetheless, the cover criterion value THcomay be determined as a maximum value among all pieces of the black dataBK. Alternatively, the cover criterion value THco may be determinedbased on the black data BK and the white data WT.

What is claimed is:
 1. An image reader comprising: a document tableconfigured to support a document placed thereon, the document tablehaving: a reference point on which a vertex of the document ispositioned; a first region within which the document is placed, thefirst region including a margin region, the margin region being definedas a range within a predetermined distance from a reference line in amain scanning direction, the reference line including the referencepoint and being parallel to a sub scanning direction perpendicular tothe main scanning direction; and a second region positionally differentfrom the first region in the main scanning direction; a document covermovable between an open state and a closed state, the document coverbeing configured to cover an upper surface of the document table whenthe document cover is in the closed state; a reading unit comprising alight source configured to emit light toward the document placed on thedocument table, the reading unit being configured to perform imagereading on a line-by-line basis along the main scanning direction, andoutput analog data as read data; a converter configured to convert theanalog data output from the reading unit into digital data; a movingmechanism configured to change a reading position where the reading unitperforms image reading, in the sub scanning direction by moving thereading unit along the sub scanning direction; and a controllerconfigured to: control the moving mechanism to change the readingposition to a particular position in the sub scanning direction; acquirespecific digital data of the second region through image reading in theparticular position with the light source turned off; determine anopen/closed state of the document cover based on the specific digitaldata; acquire first digital data of the margin region through imagereading in the particular position with the light source turned off whenthe document cover is open; acquire second digital data of the marginregion through image reading in the particular position with the lightsource turned on when the document cover is open; and determineexistence of the document in the margin region on the document table,based on a difference between the first digital data and the seconddigital data.
 2. The image reader according to claim 1, wherein theparticular position is such a position that a distance thereto from thereference point in the sub scanning direction is equal to a length of apredetermined sheet size in the sub scanning direction.
 3. The imagereader according to claim 1, wherein the controller is furtherconfigured to: determine whether the specific digital data of the secondregion is equal to or less than a specific criterion value; whendetermining that the specific digital data of the second region is equalto or less than the specific criterion value, determine that thedocument cover is in the closed state or in a state immediately beforebrought into the closed state; and when determining that the specificdigital data of the second region is more than the specific criterionvalue, determine that the document cover is in the open state.
 4. Theimage reader according to claim 1, wherein the controller is furtherconfigured to: determine whether the difference between the firstdigital data and the second digital data is more than a particularcriterion value; when determining that the difference between the firstdigital data and the second digital data is more than the particularcriterion value, determine that the document exists in the margin regionon the document table; and when determining that the difference betweenthe first digital data and the second digital data is equal to or lessthan the particular criterion value, determine that the document doesnot exist in the margin region on the document table.
 5. The imagereader according to claim 4, wherein the controller is furtherconfigured to, when determining that the document exists in the marginregion on the document table, perform a document size determiningprocess comprising: acquiring fourth digital data of the second regionthrough image reading in the particular position with the light sourceturned off when the document cover is open; acquiring fifth digital dataof the second region through image reading in the particular positionwith the light source turned on when the document cover is open;determining whether a difference between the fourth digital data and thefifth digital data is more than the particular criterion value; whendetermining that the difference between the fourth digital data and thefifth digital data is more than the particular criterion value,determining that the document has a maximum size settable on thedocument table; and when determining that the difference between thefourth digital data and the fifth digital data is equal to or less thanthe particular criterion value, determining that the document does nothave the maximum size.
 6. The image reader according to claim 5, whereinthe controller is further configured to, when determining that thedocument does not have the maximum size, perform: acquiring line data ofa single line along the main scanning direction through image reading inthe particular position with the light source turned on when thedocument cover is in the state immediately before brought into theclosed state; acquiring a value of the margin region from the acquiredline data; acquiring a value of the second region from the acquired linedata; determining a third criterion value based on the acquired value ofthe margin region and the acquired value of the second region; anddetermining a size of the document by comparing the line data with thethird criterion value.